import http from '../utils/http'

export interface EventItem {
  id: number
  pid: string
  tname1: string
  tname2: string
  created_at: string
}

export type EventApiResponse = EventItem[] | { data?: EventItem[] }

export const getEvents = (date?: string) => {
  const params = date ? { date } : {}
  return http.get<EventApiResponse>('/event', { params })
}


